<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8">
<head th:include="common/include :: header"></head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">

            <div class="panel panel-default">
                <div class="panel-body dept-tree">
                    <ul id="chooseRoleTree" class="ztree"></ul>
                </div>
            </div>

            <div class="form-group hidden">
                <div class="col-sm-12 col-sm-offset-12">
                    <button type="submit" class="btn btn-primary">提交</button>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="common/include :: footer"></div>

<script type="text/javascript">
    $(document).ready(function() {
        var ztree = new $ZTreePlus("chooseRoleTree", ctxPath + "role/roleTree");
        ztree.bindOnClick(zTreeOnClick);
        ztree.init(0);
    });
    /**
     * 点击事件
     */
    var zTreeOnClick = function (e, treeId, treeNode) {
        parent.loadRole(treeNode.id,treeNode.name);
        var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
        parent.layer.close(index);
    }
</script>
</body>

</html>
